<template>
  <el-timeline class="c-timeline">
    <template v-for="(item, i) in data">
      <el-timeline-item
        :key="i"
        :timestamp="item[option.timestamp]"
        placement="top"
      >
        <slot :item="item"></slot>
      </el-timeline-item>
    </template>
  </el-timeline>
</template>
<script>
export default {
  name: 'CTimeline',
  components: {},
  props: {
    data: {
      type: Array,
      default() {
        return []
      }
    },
    option: {
      type: Object,
      default() {
        return {
          timestamp: 'time'
        }
      }
    }
  },
  data() {
    return {}
  },
  computed: {},
  watch: {},
  beforeCreate() {},
  created() {},
  beforeMount() {},
  mounted() {},
  beforeUpdate() {},
  updated() {},
  activated() {},
  deactivated() {},
  beforeDestroy() {},
  destroyed() {},
  methods: {}
}
</script>
<style lang="scss">
.c-timeline {
  padding: 20px;
  padding-bottom: 0;
}
</style>
